<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 嵌套块元素垂直外边距的塌陷问题 */
        /* 对于两个嵌套关系的块元素,父元素有上边距,同时子元素也有上边距,则会塌陷较大的那个值 */
        div {
            width: 200px;
            height: 200px;
            background-color: red;
            margin: 10px;
        }

        div p {
            width: 100px;
            height: 100px;
            background-color: blue;
            margin: 20px;
        }
    </style>
</head>

<body>
    <div>
        <p></p>
    </div>
</body>

</html>